<?php
if ($_POST ["submit"] == '') {
	$pro->setid ( $_GET ["id"] );
	$detail = $pro->getone ();
	?>


<div id="content_wrapper">
<div id="main_content" class="cf">
<form action="" class="formEl" id="form_a" method="post" enctype="multipart/form-data">
<div class="cf sepH_c">
<div id="content_actions" class="fr">
<button class="fr next btn btn_d submitForm" name="submit" type="submit">Thêm
sản phẩm</button>
<a href="javascript:void(0)" class="clear_form btn btn_a">Clear form</a>
<a href="javascript:history.go(-1)" class="btn btn_a">Cancel</a></div>

</div>

<ul class="tabsB cf">
	<li><a href="#tab-1">Thêm sản phẩm</a></li>
	<li><a href="#tab-2">Chi tiết sản phẩm</a></li>
	<li><a href="#tab-3">Ảnh sản phẩm</a></li>
</ul>

<div class="msg_box msg_error" id="form_a_errors" style="display: none"></div>

<div class="content_panes">

<div id="tab-1">

<div class="formEl_a">

<fieldset><legend>Thông tin sản phẩm</legend>
<div class="sepH_b"><label for="title" class="lbl_a">Tên</label> <input
	type="text" id="title" name="title" class="inpt_a"
	value="<?=$detail ["name"]?>" /></div>

<div class="sepH_c cf"><label for="text" class="lbl_a">Mô tả</label> <textarea
	name="description" id="text" cols="30" rows="10"
	class="tinymce txtar_a"><?=$detail ["description"]?></textarea></div>

<div class="sepH_c cf"><label for="text" class="lbl_a">Chi tiết</label>
<textarea name="content" id="content" cols="30" rows="10"
	class="tinymce txtar_a"><?=$detail ["content"]?></textarea></div>

</fieldset>

</div>
</div>
<div id="tab-2" class="cf formEl_a">
<div class="sepH_b cf">
<div class="dp100">
<fieldset><legend>Nhóm sản phẩm</legend>
<div class="cf">
<div class="cf">
<div class="dp100"><select name="a_select" id="a_select">
														<?php
	$menu = $cat->dequy ();
	foreach ( $menu as $key => $val ) {
		if ($detail ["cat_id"] == $menu [$key] ["cat_id"]) {
			?>
                                                        	<option
		value="<?=$menu [$key] ["cat_id"]?>" selected="selected"><?=$menu [$key] ["cat_name"]?></option>
                                                        <?php
		} else {
			?>
                                                        	<option
		value="<?=$menu [$key] ["cat_id"]?>"><?=$menu [$key] ["cat_name"]?></option>
                                                        <?php
		}
	}
	?>
                                                 	</select></div>
</div>
</div>
</fieldset>
<fieldset><legend>Thông tin</legend>
<div class="cf">
<div class="cf">
<div class="dp33"><input type="checkbox" name="banchay" class="inpt_c"
	id="checkbox1"
	<?php
	if ($detail ["banchay"]) {
		echo 'checked="checked"';
	}
	?> /><label
	for="checkbox1" class="lbl_c">Sản phẩm bán chạy</label></div>
<div class="dp33"><input type="checkbox" name="tieubieu" class="inpt_c"
	id="checkbox2"
	<?php
	if ($detail ["tieubieu"]) {
		echo 'checked="checked"';
	}
	?> /><label
	for="checkbox2" class="lbl_c">Sản phẩm tiêu biểu</label></div>
<div class="dp33"><input type="checkbox" name="status" class="inpt_c"
	id="checkbox3"
	<?php
	if ($detail ["status"]) {
		echo 'checked="checked"';
	}
	?> /><label
	for="checkbox3" class="lbl_c">Trạng thái</label></div>
</div>
</div>
</fieldset>

</div>
</div>
<div class="formEl_a">
<fieldset><legend>Ngày cập nhật</legend>
<div class="cf">
<div class="dp50"><label for="publish" class="lbl_a">Publish Date</label>
<input type="text" id="publish" name="date" class="inpt_b datepicker"
	readonly="readonly" value="<?=date ( "m/d/Y", $detail ["date"] )?>" /></div>

</div>
</fieldset>
</div>
</div>
<div id="tab-3" class="cf formEl_a">
<div class="formEl_b">
<fieldset><legend>Hình ảnh</legend>
<div class="sepH_c"><label class="lbl_a">Ảnh sản phẩm</label>
<div class="lblSpace">
<div><input type="file" name="anh_san_pham" id="upload" /></div>
</div>
</div>
<div class="sepH_c"><label class="lbl_a">Ảnh kỹ thuật</label>
<div class="lblSpace">
<div><input type="file" name="anhkt1" id="upload" /></div>
</div>
</div>
<div class="sepH_c"><label class="lbl_a">Ảnh kỹ thuật</label>
<div class="lblSpace">
<div><input type="file" name="anhkt2" id="upload" /></div>
</div>
</div>
<div class="sepH_c"><label class="lbl_a">Ảnh kỹ thuật</label>
<div class="lblSpace">
<div><input type="file" name="anhkt3" id="upload" /></div>
</div>
</div>
<div class="sepH_c"><label class="lbl_a">Ảnh kỹ thuật</label>
<div class="lblSpace">
<div><input type="file" name="anhkt[]" id="upload" /></div>
</div>
</div>
</fieldset>
</div>
</div>
</div>
</form>
</div>
</div>

<link rel="stylesheet" href="lib/elfinder/css/elfinder.full.css"
	type="text/css" />
<link rel="stylesheet" href="lib/fancybox/jquery.fancybox-1.3.4.css"
	type="text/css" />
<link rel="stylesheet" href="lib/file-uploader/fileuploader.css"
	type="text/css" />

<script type="text/javascript">
		head.js(
			"js/jquery-1.6.2.min.js",
			"lib/jquery-ui/jquery-ui-1.8.15.custom.min.js",
			"lib/harvesthq-chosen/chosen.jquery.min.js",
			"lib/fusion-charts/FusionCharts.js",
			"lib/fancybox/jquery.easing-1.3.pack.js",
			"lib/fancybox/jquery.fancybox-1.3.4.pack.js",
			"lib/file-uploader/fileuploader.js",
			"lib/tiny-mce/jquery.tinymce.js",
			"js/jquery.microaccordion.js",
			"js/jquery.tools.min.js",
			"js/jquery.stickyPanel.js",
			"js/xbreadcrumbs.js",
			"lib/jquery-validation/jquery.validate.js",
			"js/lagu.js",
			function(){
				lga_fusionCharts.chart_k();
				lga_flowTabs.tabs_b();
				lga_selectBox.init();
				lga_datepicker.init();
				lga_editor.init();
				lga_sticky.sticky_contentActions();
				lga_clearForm.init();
				lga_fileUpload.init();
				lga_form_a_validation.init();
			}
		)
    </script>
<?php
} else {

}
?>